package com.demo.nacos.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author admin
 */
@RestController
@RefreshScope
@RequestMapping("/nacos")
public class NacosController {

    @Value("${user-y.name}")
    private String name;

    @Value("${user-y.age}")
    private int age;

    @RequestMapping("/test")
    public void test(){
        System.out.println("name:" + name + " - age:" + age) ;
    }
}
